package com.ooa;

/**
 * @author Li
 * @Date 2023/4/6 12:44
 */
public class Application {
    public static void main(String[] args) {
        Attack phyAttack = new PhyAttack(20);
        Person person = new Person("小明", 100, phyAttack);
        person.useAttack();
        System.out.println(person.getName()+"使用物理攻击"+"  "+"伤害为:"+phyAttack.damage+"  "+"剩余血量:"+person.getBlood());
        Attack magAttack = new MagAttack(10);
        Person person1 = new Person("小红",100,magAttack);
        person1.useAttack();
        System.out.println(person1.getName()+"使用魔法攻击"+"  "+"伤害为:"+magAttack.damage+"  "+"剩余血量:"+person1.getBlood());
    }
}
